﻿using System;
using System.Windows.Forms;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using YArchitech.Revit;

namespace YArchitech.HVAC
{
	[Transaction(TransactionMode.Manual)]
	[Regeneration(RegenerationOption.Manual)]
	public class LayPressDuctTerminal : HYNoTranExternalCommand
	{
		public override Result HYExecute()
		{
			Transaction transaction = new Transaction(base.Doc, "加压风口布置");
			transaction.Start();
			FrmPressDuctTerminal frmPressDuctTerminal = new FrmPressDuctTerminal();
			if (frmPressDuctTerminal.ShowDialog() == DialogResult.OK)
			{
				new PressDuctTerminalOperation(base.UiDoc, frmPressDuctTerminal).layfs(transaction);
			}
			frmPressDuctTerminal.Close();
			if (transaction != null && (int)transaction.GetStatus() == 1)
			{
				transaction.Commit();
			}
			return Autodesk.Revit.UI.Result.Succeeded;
		}
	}
}
